package com.joey.cart.controller;

import com.joey.cart.service.TestService;
import com.cloud.api.client.ItemOrder;
import com.cloud.api.dto.GoodsCategoryDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: Joey
 * @Description:
 * @date:2024/6/9 23:55
 */
@RestController
@RequestMapping("/cart")
@Slf4j
public class TestCartController {

    @Autowired
    private TestService testService;
    @Autowired
    private ItemOrder itemOrder;
    
    @GetMapping("/send")
    public String send(){
        List<GoodsCategoryDto> queryOrder3 = itemOrder.queryOrder3();
        log.info("正在调用Category...");
        System.out.println(queryOrder3);
        return "itemOrder.queryOrder3() is ok";
    }

    @GetMapping("/query")
    public String send2(){
        log.error("正在被调用");
        return testService.TestToSend2();
    }

}
